package com.search.entity;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Mapping;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Document(indexName = "xiangyuantang-item", type = "item")
public class Item implements Serializable {
    @Id
    private Long id;

    @Field(type = FieldType.Text, name = "name", analyzer = "ik_smart")
    private String name;
    @Field(type = FieldType.Double, name = "quantity")
    private BigDecimal quantity;
    @Field(type = FieldType.Text, name = "specs")
    private String specs;
    @Field(type = FieldType.Double, name = "salePrice")
    private BigDecimal salePrice;
    @Field(type = FieldType.Long, name = "categoryId")
    private Long categoryId;
    @Field(type = FieldType.Long, name = "storeId")
    private Long storeId;
    @Field(type = FieldType.Text, name = "drugsNo")
    private String drugsNo;
    @Field(type = FieldType.Date, name = "expireTime")
    private Date expireTime;
    @Field(type = FieldType.Date, name = "produceTime")
    private Date produceTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(BigDecimal salePrice) {
        this.salePrice = salePrice;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public Long getStoreId() {
        return storeId;
    }

    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    public Date getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    public Date getProduceTime() {
        return produceTime;
    }

    public void setProduceTime(Date produceTime) {
        this.produceTime = produceTime;
    }

    public BigDecimal getQuantity() {
        return quantity;
    }

    public void setQuantity(BigDecimal quantity) {
        this.quantity = quantity;
    }

    public String getSpecs() {
        return specs;
    }

    public void setSpecs(String specs) {
        this.specs = specs;
    }

    public String getDrugsNo() {
        return drugsNo;
    }

    public void setDrugsNo(String drugsNo) {
        this.drugsNo = drugsNo;
    }
}
